package com.adapters;

import java.util.ArrayList;

import android.content.Context;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.objects.Group;
import com.objects.SecurePackageLog;
import com.senditcertified.mail.R;
import com.views.ACheckBox;

public class SecurePackageLogsAdapter extends BaseAdapter {
	private Context mContext;
	private ArrayList<SecurePackageLog> lst;
	private LayoutInflater inflater = null;

	public SecurePackageLogsAdapter(Context mContext,
			ArrayList<SecurePackageLog> lst) {
		this.mContext = mContext;
		this.lst = lst;
		this.inflater = (LayoutInflater) mContext
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

	}

	public int getCount() {
		if (lst == null)
			return 0;
		else
			return lst.size();
	}

	public long getItemId(int position) {
		return position;
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		View v = convertView;
		SecurePackageLog item = getItem(position);
		if (convertView == null) {
			v = inflater.inflate(R.layout.item_secure_package_log, null);
		}
		TextView tvDate = (TextView) v.findViewById(R.id.tv_date);
		TextView tvDes = (TextView) v.findViewById(R.id.tv_description);
		TextView tvStatus = (TextView) v.findViewById(R.id.tv_status);
		tvDate.setText(item.getDate());
		tvDes.setText(item.getDescription());
		tvStatus.setText(item.getStatus());

		return v;
	}

	@Override
	public SecurePackageLog getItem(int arg0) {
		return lst.get(arg0);
	}

}